home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 013 / lu.arc / LU.DOC next >
Encoding:
Text File  |  1986-11-25  |  6.0 KB  |  147 lines

  1.  
  2.  
  3. LU is a utility to manipulate "LBR" files generated by the PC-DOS
  4. utility of the same name.  The most common use is to pack a group of
  5. related files into a single .LBR file, for modem transfers or 
  6. for archiving.
  7.  
  8. LU or an equivelant program is usually required to "unpack" the
  9. software packages available on the Chesapeake Remote Bulletin Board
  10. System.
  11.  
  12. .LBR files are a special file generated by LU (or whatever) that
  13. contain one or more DOS files, and a simple directory. Whenever an
  14. existing library is changed (files changed or deleted) the library
  15. requires "reorganizing".  More on this below.
  16.  
  17. LU operation is quite simple.  There are only a few commands.  Each
  18. is described below, and a quick summary can be obtained by running
  19. LU like so:
  20.  
  21. LU <cr>
  22.  
  23. OPERATING LU
  24.  
  25. LU commands, etc are entered on the command line after the program
  26. name.  You must ALWAYS enter a command letter, below, and the name of
  27. an LBR file, followed by file names, if needed:
  28.  
  29. LU <command> <lbr file name> { <optional filenames> }
  30.  
  31. For example,
  32.  
  33. LU T FILE.LBR
  34.  
  35. Lists all the files contained within the LBR file 
  36. FILE.LBR.
  37.  
  38.                      L U    C O M M A N D S
  39.  
  40. All LU commands are a single letter. Only one can be entered
  41. at a time.
  42.  
  43. A Unpack all files from the library.  This is the same  as 
  44. the E (extract) command,  followed by all the file names. This is 
  45. much easier if all you want to do is remove all the files.
  46.  
  47.  
  48. T List all files contained in the LBR file.  Each filename 
  49. is listed, along with the size of the file in bytes, and its 
  50. starting offset within the LBR file.  (The offset is pretty 
  51. useless information, but there it is.)
  52.  
  53. L Same as T.
  54.  
  55. E Extract a file from the library.  The file(s) to be 
  56. extracted are entered after the LBR file name.  Each file will be 
  57. extracted, and copied to a disk file of the same name.
  58.  
  59. U Update a library.  This is also used to create new 
  60. libraries.  File name(s) are entered after the LBR file name, and 
  61. each file is added to the library.  Any file of the same name 
  62. already in the library will be deleted first, otherwise just 
  63. added. Pleas read about reorganizing, below.
  64.  
  65. If the library file does not exist (creating a new  one) 
  66. then you are asked for the number of new slots for the library. 
  67. "Slots"  means the maximum number of files that the LBR file can 
  68. contain.  The number you enter is rounded up to the next highest 
  69. multiple of four;  this is just a peculiarity of the LBR file 
  70. structure.  It does not hurt anything.  After the new library is 
  71. created, any specified files are added to it.
  72.  
  73. D Delete a file. The just marks the file within the library 
  74. as "deleted".  The library file will NOT change in size;  it does 
  75. not remove the data contained by the file.  See "reorganization", 
  76. below.
  77.  
  78. R Reorganize  the library.  All free space  (from  deleted 
  79. files,  or existing files that were Updated) is freed up, and the 
  80. LBR file generally becomes smaller. Should be used after a Delete 
  81. or Update command.  Creates a temporary file called LU$$$$$$.TMP, 
  82. therfore you should not use this file name elsewhere.
  83.  
  84.                      R E O R G A N I Z I N G
  85.  
  86. The structure of an .LBR file (described in detail  below) 
  87. is very simple. Because of its simplicity, files that are deleted 
  88. or changed still consume space within the LBR file, which must be 
  89. "squeezed" whenever the library is changed.
  90.  
  91. Deleteing  a file merely marks the file as "deleted";  it 
  92. does not remove the data contained in the LBR file. Updated files 
  93. are deleted first, and also consume space. Therefore, the library 
  94. must be reorganized. This consists of creating a new library, and 
  95. copying the active files to it,  dropping out all the deleted  or 
  96. changed data.
  97.  
  98. The  rule  is:  reorganize  after  deleting  a  file,  or 
  99. updating a file that already existed.  If the library runs out of 
  100. slots,  and you want to add more files,  reorganize and specify a 
  101. larger number of slots. You can then add to the library.
  102.  
  103. Reorganizing never does any harm, in any case.
  104.  
  105.  
  106.               L B R    F I L E    S T R U C T U R E
  107.  
  108. The  LBR  file  is  a disk file that  contains  a  simple 
  109. directory,  followed by all the data contained in the files.  New 
  110. files  are added to the end of the LBR file,  and  the  directory 
  111. entry for each file points to the data,  and contains its length. 
  112. Each directory entry is:
  113.  
  114. 00:file status (0= active, FF= deleted, FE= unused)
  115. 01:11 character filename (FCB format)
  116. 12:16 bit offset to start of data (in sectors)
  117. 14:16 bit data length (in sectors)
  118. 16:16 bytes of filler
  119.  
  120. Since the original program was written in BDS C, all 
  121. offsets and lengths are in multiples of 128  bytes, the CP/M 
  122. "sector  size".  LU multiplies these values by 128 before using. 
  123. (Also, all file sizes are rounded up to the nearest 128 bytes.)
  124.  
  125. The offset is the location of the data for the file, 
  126. relative to the start of the LBR file.
  127.  
  128. The first directory entry is the directory itself.  The 
  129. filename is always blank, the offset is not used, and the length 
  130. is the length of the directory. Since the length is a multiple of 
  131. 128, LU rounds up the number of slots when creating a new .LBR 
  132. file to a multiple of four. (32 bytes per entry * 4 == 128).
  133.  
  134.                     P E C U L I A R I T I E S
  135.  
  136. There are only two peculiarities (nice way of saying 
  137. "bugs") that I know of: Filenames without extentions, like "FILE" 
  138. instead of "FILE.EXT" should be entered without a dot.  Entering 
  139. with a dot will cause "NOT FOUND" errors to be generated.  (I.e. 
  140. use "FILE" not "FILE.".  Two, not really a bug, but a side effect 
  141. of the original design: all files are rounded up to the nearest 
  142. 128 bytes.  This does not matter for most files, but some, like 
  143. spreadsheet files, will not work unless the size is exactly 
  144. right.  LU (or equivalent) cannot be used with such files. Try it 
  145. and see what happens.
  146.  
  147. rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr